<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>
	<div id="app">
		<p>
		    <span v-if="result == 1">结果1</span>
		    <span v-else>结果2</span>
		    <button @click="changeResult">改变结果</button>
		</p>
		<p>
			<span v-show="result1">结果1</span>
    		<span v-show=" ! result1">结果2</span>
    		<button @click="changeResult1">改变结果1</button>
		</p>
	</div>
	<script type="text/javascript" src="../js/vue.js"></script>
	<script type="text/javascript">
		var vm = new Vue({
			el: '#app',
			data : {
				result : 2,
				result1: 0
			},
			methods: {
				changeResult: function () {
					this.result = this.result == 1? 2: 1;
				},
				changeResult1: function () {
					this.result1 = this.result1 == 1? 0: 1;
				}
			}
		});
	</script>
</body>
</html>